# -*- coding: utf-8 -*-
"""
Created on Mon Jan 23 12:50:32 2023

@author: wulong
"""
import numpy as np

def tras_opt_xs_h(X_int, opt_eva, seed_h_s):
    
    opt_xs_h = np.zeros((int(seed_h_s*24+1), 2))
    
    Xs_guess = np.vstack((X_int.reshape(1,-1), opt_eva))
    
    for i in range (24):
        j = i*seed_h_s
        k = (i+1)*seed_h_s
        if i != 23:
            opt_xs_h[j:k,0] = np.linspace(Xs_guess[i,0], Xs_guess[i+1,0],
                                          num=seed_h_s, endpoint=False)
            opt_xs_h[j:k,1] = np.linspace(Xs_guess[i,1], Xs_guess[i+1,1],
                                          num=seed_h_s, endpoint=False)
        else:
            opt_xs_h[j:k+1,0] = np.linspace(Xs_guess[i,0], Xs_guess[i+1,0],
                                            num=seed_h_s+1)
            opt_xs_h[j:k+1,1] = np.linspace(Xs_guess[i,1], Xs_guess[i+1,1],
                                            num=seed_h_s+1)
            pass
        pass
    
    Opt_xs_h_temp = np.delete(opt_xs_h, 0, axis=0)
    
    Opt_xs_h = np.tile(Opt_xs_h_temp, (2,1))
    
    return Opt_xs_h
